package com.webchat.chat.dao;

import com.webchat.chat.core.Mapper;
import com.webchat.chat.core.enums.SocketRoomStatus;
import com.webchat.chat.model.RoomClient;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoomClientMapper extends Mapper<RoomClient> {

    /**
     * 通过roomId查询
     * @param roomId
     * @return
     */
    RoomClient selectByRoomId(@Param("roomId") String roomId, @Param("clientId") String clientId);

    /**
     * 通过roomId查询
     * @param roomId
     * @return
     */
    List<RoomClient> selectRoomClientsByRoomId(@Param("roomId") String roomId);

    /**
     * 查询房间信息通过clientID
     * @param clientId
     * @param status
     * @return
     */
    List<RoomClient> selectByClientId(@Param("clientId") String clientId, @Param("status") SocketRoomStatus status);

    /**
     * 通过roomId和状态查询
     */
    List<RoomClient> selectRoomClientsByRoomIdAndStatus(@Param("roomId") String roomId, @Param("status") SocketRoomStatus status);

}